package com.eliza.base.views.component

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.sharp.Send
import androidx.compose.material.icons.rounded.Face
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.composable
import androidx.navigation.compose.navigation
import com.eliza.base.views.component.bottomSheets.BottomSheetsScreen
import com.eliza.base.views.component.listsAndGrids.ListGridsScreen
import com.eliza.base.views.component.navigationDrawer.ModalNavigationDrawerX
import com.eliza.base.views.component.progress.AppBarX
import com.eliza.base.views.component.progress.ButtonsScreen
import com.eliza.base.views.component.progress.CardX
import com.eliza.base.views.component.progress.ChipsX
import com.eliza.base.views.component.progress.DialogX
import com.eliza.base.views.component.progress.FabX
import com.eliza.base.views.component.progress.ProgressX
import com.eliza.base.views.component.progress.SnackBarX
import com.eliza.base.views.component.resources.ResourcesScreen
import com.eliza.base.views.component.slider.SliderScreen
import com.eliza.base.views.component.switch.SwitchScreen
import com.eliza.library.ui.inter.IBaseRoute
import com.eliza.library.ui.inter.INavScreen


enum class NavComponentEnum(
    override val title: String,
    override val imageVector: ImageVector,
    override val content: @Composable (NavController) -> Unit
) : IBaseRoute {
    Navigation("Navigation", Icons.Rounded.Face, { Text(text = "aaaa") }),
    AppBar("AppBar", Icons.AutoMirrored.Sharp.Send, { AppBarX.Show(it) }),
    Buttons("Buttons", Icons.AutoMirrored.Sharp.Send, { ButtonsScreen(it) }),
    Fab("Fab", Icons.AutoMirrored.Sharp.Send, { FabX.Show(it) }),
    Cards("Cards", Icons.AutoMirrored.Sharp.Send, { CardX.Show(it) }),
    Chips("Chips", Icons.AutoMirrored.Sharp.Send, { ChipsX.Show(it) }),
    Dialogs("Dialogs", Icons.AutoMirrored.Sharp.Send, { DialogX.Show(it) }),
    Lists("Lists", Icons.AutoMirrored.Sharp.Send, { Text(text = "sddd") }),
    ProgressIndicators("ProgressIndicators", Icons.AutoMirrored.Sharp.Send, { ProgressX.Show(it) }),
    Slider("Slider", Icons.AutoMirrored.Sharp.Send, { SliderScreen(it) }),
    Switch("Switch", Icons.AutoMirrored.Sharp.Send, { SwitchScreen(it) }),
    BottomSheets("BottomSheets", Icons.AutoMirrored.Sharp.Send, { BottomSheetsScreen(it) }),
    NavigationDrawer(
        "NavigationDrawer",
        Icons.AutoMirrored.Sharp.Send,
        { ModalNavigationDrawerX.Show(it) }),
    SnackBar("SnackBar", Icons.AutoMirrored.Sharp.Send, { SnackBarX.Show(it) }),
    ListsAndGrids("ListsAndGrids", Icons.AutoMirrored.Sharp.Send, { ListGridsScreen(it) }),
    Resources("Resources", Icons.AutoMirrored.Sharp.Send, { ResourcesScreen(it) }), ;

    companion object : INavScreen {
        override fun RegisterRoute(navController: NavHostController,nav: NavGraphBuilder) {
            nav.navigation(
                startDestination = Navigation.title,
                route = "NavComponentEnum"
            ) {
                NavComponentEnum.entries.forEach { route ->
                    composable(route.title) {
                        route.content(navController)
                    }
                }
            }
        }
    }

}

